import request from '@/utils/request'

// 查询发货申请表列表
export function listDeliverOrderPage(query) {
  return request({
    url: '/tms/deliverOrder/listPage',
    method: 'get',
    params: query
  })
}

// 查询发货申请表列表
export function listDeliverOrderUniPage(query) {
  return request({
    url: '/tms/deliverOrder/listUniPage',
    method: 'get',
    params: query
  })
}

// 查询发货申请表列表
export function listDeliverOrderdDetailPage(query) {
  return request({
    url: '/tms/deliverOrderDetail/list',
    method: 'get',
    params: query
  })
}

// 查询发货申请表列表
export function listDeliverOrder(query) {
  return request({
    url: '/tms/deliverOrder/list',
    method: 'get',
    params: query
  })
}

// 查询发货申请表详细
export function getDeliverOrder(deliverNo) {
  return request({
    url: '/tms/deliverOrder/' + deliverNo,
    method: 'get'
  })
}

// 新增发货申请表
export function addDeliverOrder(data) {
  return request({
    url: '/tms/deliverOrder',
    method: 'post',
    data: data
  })
}

// 修改发货申请表
export function updateDeliverOrder(data) {
  return request({
    url: '/tms/deliverOrder',
    method: 'put',
    data: data
  })
}

// 删除发货申请表
export function delDeliverOrder(deliverNo) {
  return request({
    url: '/tms/deliverOrder/' + deliverNo,
    method: 'delete'
  })
}

// 查询调拨单号
export function getTransferNo(deliverNo) {
  return request({
    url: '/tms/ec/getTransferNo/' + deliverNo,
    method: 'get'
  })
}

// 删除发货申请表
export function delDeliverOrderByNo(deliverNo) {
  return request({
    url: '/tms/ec/removeDeliverOrder/' + deliverNo,
    method: 'delete'
  })
}

export function statusSyncByOptName() {
  return request({
    url: '/tms/ec/statusSyncByOptName',
    method: 'post',
    timeout: 240000 ,
  })
}


// 查询客户地址管理列表
export function listAddressCustName(query) {
  return request({
    url: '/tms/address/listCustName',
    method: 'get',
    params: query
  })
}

// 撤回发货申请表
export function withDrawDeliverOrder(deliverNo) {
  return request({
    url: '/sales/saleOrder/withDrawDeliverOrder/' + deliverNo,
    method: 'delete'
  })
}